// This file is part of Acala.

// Copyright (C) 2020-2025 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for module_nominees_election
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-04-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `192.168.1.3`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: Compiled, CHAIN: Some("karura-dev"), DB CACHE: 1024

// Executed Command:
// target/production/acala
// benchmark
// pallet
// --chain=karura-dev
// --steps=50
// --repeat=20
// --pallet=*
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/karura/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for module_nominees_election.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_nominees_election::WeightInfo for WeightInfo<T> {
	// Storage: `NomineesElection::Ledger` (r:1 w:1)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	// Storage: `NomineesElection::Nominations` (r:1 w:0)
	// Proof: `NomineesElection::Nominations` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn bond() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2634`
		//  Estimated: `6099`
		// Minimum execution time: 39_000 nanoseconds.
		Weight::from_parts(40_000_000, 6099)
			.saturating_add(T::DbWeight::get().reads(6))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `Homa::RelayChainCurrentEra` (r:1 w:0)
	// Proof: `Homa::RelayChainCurrentEra` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `NomineesElection::Ledger` (r:1 w:1)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `NomineesElection::Nominations` (r:1 w:0)
	// Proof: `NomineesElection::Nominations` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn unbond() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2388`
		//  Estimated: `5853`
		// Minimum execution time: 40_000 nanoseconds.
		Weight::from_parts(41_000_000, 5853)
			.saturating_add(T::DbWeight::get().reads(7))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `NomineesElection::Ledger` (r:1 w:1)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `NomineesElection::Nominations` (r:1 w:0)
	// Proof: `NomineesElection::Nominations` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::PoolInfos` (r:1 w:1)
	// Proof: `Rewards::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Rewards::SharesAndWithdrawnRewards` (r:1 w:1)
	// Proof: `Rewards::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[1, 7]`.
	fn rebond(_c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2266`
		//  Estimated: `5731`
		// Minimum execution time: 36_000 nanoseconds.
		Weight::from_parts(37_652_826, 5731)
			.saturating_add(T::DbWeight::get().reads(6))
			.saturating_add(T::DbWeight::get().writes(5))
	}
	// Storage: `Homa::RelayChainCurrentEra` (r:1 w:0)
	// Proof: `Homa::RelayChainCurrentEra` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `NomineesElection::Ledger` (r:1 w:1)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::Locks` (r:1 w:1)
	// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1300), added: 3775, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:1 w:1)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	/// The range of component `c` is `[1, 7]`.
	fn withdraw_unbonded(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2168`
		//  Estimated: `5633`
		// Minimum execution time: 33_000 nanoseconds.
		Weight::from_parts(34_118_349, 5633)
			// Standard Error: 21_099
			.saturating_add(Weight::from_parts(96_491, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(4))
			.saturating_add(T::DbWeight::get().writes(3))
	}
	// Storage: `NomineesElection::Ledger` (r:1 w:0)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `HomaValidatorList::ValidatorBackings` (r:16 w:0)
	// Proof: `HomaValidatorList::ValidatorBackings` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`)
	// Storage: `NomineesElection::Nominations` (r:1 w:1)
	// Proof: `NomineesElection::Nominations` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `NomineesElection::Votes` (r:16 w:16)
	// Proof: `NomineesElection::Votes` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[1, 16]`.
	fn nominate(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1508 + c * (72 ±0)`
		//  Estimated: `4973 + c * (2547 ±0)`
		// Minimum execution time: 22_000 nanoseconds.
		Weight::from_parts(19_125_174, 4973)
			// Standard Error: 12_496
			.saturating_add(Weight::from_parts(3_924_043, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2547).saturating_mul(c.into()))
	}
	// Storage: `NomineesElection::Ledger` (r:1 w:0)
	// Proof: `NomineesElection::Ledger` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `NomineesElection::Nominations` (r:1 w:1)
	// Proof: `NomineesElection::Nominations` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `NomineesElection::Votes` (r:16 w:16)
	// Proof: `NomineesElection::Votes` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[1, 16]`.
	fn chill(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1372 + c * (93 ±0)`
		//  Estimated: `4835 + c * (2569 ±0)`
		// Minimum execution time: 21_000 nanoseconds.
		Weight::from_parts(19_737_152, 4835)
			// Standard Error: 11_893
			.saturating_add(Weight::from_parts(2_815_068, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 2569).saturating_mul(c.into()))
	}
	// Storage: `NomineesElection::ReservedNominees` (r:0 w:4)
	// Proof: `NomineesElection::ReservedNominees` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `c` is `[1, 4]`.
	fn reset_reserved_nominees(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1001`
		//  Estimated: `1001`
		// Minimum execution time: 11_000 nanoseconds.
		Weight::from_parts(8_689_832, 1001)
			// Standard Error: 19_101
			.saturating_add(Weight::from_parts(3_395_132, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
	}
}
